package com.xiaotao.controller;

import com.mybatisflex.core.query.QueryWrapper;
import com.xiaotao.mapper.SysUserMapper;
import com.xiaotao.pojo.SysUser;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.xiaotao.pojo.table.SysUserTableDef.SYS_USER;

/**
 * @author xiaotao
 */
@RestController
@RequiredArgsConstructor
public class SysUserController {
    @Resource
    private SysUserMapper userMapper;

    @GetMapping("getUser")
    public Object getUser(){
        QueryWrapper where = QueryWrapper.create().select().where(SYS_USER.USER_ID.eq(1));
        SysUser sysUser = userMapper.selectOneByQuery(where);
        return userMapper.selectAll();
    }
}
